package com.isorf.test;



public class homework {

    public int sanjiao;
    private int zhengfang;
    private int ti;

    // 计算1-10的和
    public int calculateSum() {
        int sum = 0;
        for (int i = 1; i <= 10; i++) {
            sum += i;
        }
        return sum;
    }

    // 计算三角形的面积 (底*高/2)
    public double calculateTriangleArea(double base, double height) {
        return base * height / 2;
    }

    // 计算正方形的面积 (边长*边长)
    public double calculateSquareArea(double side) {
        return side * side;
    }

    // 计算梯形的面积 ((上底+下底)*高/2)
    public double calculateTrapezoidArea(double topBase, double bottomBase, double height) {
        return (topBase + bottomBase) * height / 2;
    }
}


